/**
 * 
 */
$.validator.setDefaults({});

$().ready(function() {
	// validate signup form on keyup and submit
	$("#signupform").validate({
		rules : {
			first_name : {
				required : true,
				minlength : 3
			},
			last_name : {
				required : true,
				minlength : 3
			},
			passwrd : {
				required : true,
				minlength : 5
			},
			verifypasswrd : {
				required : true,
				minlength : 5,
				equalTo : "#passwrd"
			},
			email_address : {
				required : true,
				email : true
			},
		},
		errorPlacement : function(error, element) {
			$(element).tooltipster('update', $(error).text());
			$(element).tooltipster('show');
		},
		success : function(label, element) {
			$(element).tooltipster('hide');
		}
	})
});

$(function() {
	$('#signupform input[type="text"], input[type="email"], input[type="password"]').tooltipster({
		trigger : 'custom', // default is 'hover' which is no good here
		onlyOne : false, // allow multiple tips to be open at a time
		position : 'right' // display the tips to the of the element

	});
});